package com.tencent.iov.cowin.befsale.clue.value.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * @Describe: 跟进内容类型
 * @author: whp
 * @created: 2021-12-01 18:22:10
 * @version: 1.0
 */
@Getter
@AllArgsConstructor
public enum FollowContentEnum {
    //产品介绍 到店接待，试乘试驾，下订，交车）

    PRODUCT_INTRO(0,"产品介绍"),
    CHECKIN(1,"到店接待"),
    DRIVE_TEST(2,"试乘试驾"),
    ORDER(3,"下订"),
    DELIVERY(4,"交车");

    Integer code;
    String name;

    public static FollowContentEnum getByCode(Integer code) {
        return Stream.of(FollowContentEnum.values())
                .filter(enums -> enums.code.equals(code))
                .findAny().orElse(null);
    }

    /**
     * 跟进type获
     * @param code
     * @return
     */
    public static String getDictionaries(Integer code){
        for (FollowContentEnum fc : FollowContentEnum.values()) {
            if(fc.getCode().equals(code)){
                return fc.getName();
            }
        }
        return null;
    }
}
